
#ifndef MQTTSUBSCRIBE_DATA
#define MQTTSUBSCRIBE_DATA

#include <stdint.h>

#define MqttSubscribe_MsgLength 50
typedef enum
{
  SubMsgID_Poweron,
  SubMsgID_Poweroff,
  SubMsgID_SetempRTD0,
  SubMsgID_SetempRTD1,
  SubMsgID_SetempRTD2,
  SubMsgID_SetTimerA,
  SubMsgID_SetTimerB,
  SubMsgID_SetUnit,
  SubMsgID_Ignite,
  SubMsgID_Shutoff,
  SubMsgID_Cancel, //取消熄火
  SubMsgID_Smoke,
  SubMsgID_Keepwarm,
  SubMsgID_UpdateFirmware,
  SubMsgID_SetAll,
}MqttSubscribe_MsgID_E;
typedef struct 
{
  MqttSubscribe_MsgID_E MqttSubscribe_MsgID:8;
  uint8_t MqttSubscribe_BufLength:8;
  uint16_t crc16:16;
  uint32_t result:32;
  char Param[MqttSubscribe_MsgLength];
}MqttSubscribe_Msg_S;

typedef union
{
  MqttSubscribe_Msg_S MqttSubscribe_Msg;
  uint8_t MqttSubscribe_Buf[MqttSubscribe_MsgLength + 4];
}MqttSubscribe_Data_U;
extern MqttSubscribe_Data_U MqttSubscribe_Data;

uint8_t* MqttSubscribe_Encode(MqttSubscribe_MsgID_E msgID, uint8_t length, uint8_t param[]);
MqttSubscribe_Msg_S MqttSubscribe_Decode(uint8_t buf[]);
void MqttSubscribe_Reset(void);

#endif
